#ifndef _CONFIG_H
#define _CONFIG_H

#define ConfigFileName "/ClIRC.dat"
#define WiFiConfigFileName "/WiFiConf.dat"

#define Config_LoadData(Data, Len) {\
	for (u32 i = 0; i < Len; i++)\
	fread((u8*)(Data)+i, 1, 1, ConfigFile);}
#define Config_SaveData(Data, Len) {\
	for (u32 i = 0; i < Len; i++)\
	fwrite((u8*)(Data)+i, 1, 1, ConfigFile);}
#define Config_SaveArrayToFile(Data) Config_SaveData(Data, sizeof(Data));
#define Config_LoadArrayFromFile(Data) Config_LoadData(Data, sizeof(Data));
#define Config_SaveDataToFile(Data) Config_SaveData(& Data, sizeof(Data));
#define Config_LoadDataFromFile(Data) Config_LoadData(& Data, sizeof(Data));

//#define Config_LoadData(Data, Len) fread(Data, Len, 1, ConfigFile);
//#define Config_SaveData(Data, Len) fwrite(Data, Len, 1, ConfigFile);

void Config_LoadConfig();
void Config_SaveConfig();
void Config_SaveConfigWiFiOnly();
void Config_ShowDiskette();
void Config_HideDiskette();
FILE* Myfopen(char* dir, char* fname, char* mode, char* &newname);
void Myfclose(FILE* file);
void Config_ShowRSOD();

#define OutputCenterText(screen, line, text) PA_OutputSimpleText(screen, 16-strlen(text)/2, line, text)

#endif
